<?php 
include_once 'include/func.class.php';
?>
<script type="text/javascript" src="js/ajax.js"></script>
<?php
if($_REQUEST['action']=='editcon'){
	
	$username=$_POST['username'];
	$password=$_POST['password'];
	$webname = $_POST['webname'];
	$keyword = $_POST['keyword'];
	$description = $_POST['description'];
	$copyright = $_POST['copyright'];
	
	$sql="update admin set username='$username'";
	if($password!=''){
		$password=md5(md5($password));
		$sql.=",password='$password'";
		$_SESSION['admin']=='';
		setcookie('user_id',null,time()-1);
	}
	$sql.=" where username='".$_SESSION['admin']."'";
	mysql_query($sql) or die(mysql_error().'<br>'.$sql);
	
	
	$sql = "update webconfig set webname = '$webname', keyword = '$keyword', description = '$description', copyright = '$copyright'";
	mysql_query($sql) or die(mysql_error().'<br>'.$sql);
	
	alert('Modify success');
	goback();
}
?>
